package com.mt.demo.service.impl;

import com.mt.demo.util.DateUtils;
import com.mt.demo.domain.MtMemberDetail;
import com.mt.demo.mapper.MtMemberDetailMapper;
import com.mt.demo.service.IMtMemberDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 成员进出明细Service业务层处理
 * 
 * @author gary
 * @date 2025-08-11
 */
@Service
public class MtMemberDetailServiceImpl implements IMtMemberDetailService 
{
    @Autowired
    private MtMemberDetailMapper mtMemberDetailMapper;

    /**
     * 查询成员进出明细
     * 
     * @param detailId 成员进出明细主键
     * @return 成员进出明细
     */
    @Override
    public MtMemberDetail selectMtMemberDetailByDetailId(Long detailId)
    {
        return mtMemberDetailMapper.selectMtMemberDetailByDetailId(detailId);
    }

    /**
     * 查询成员进出明细列表
     * 
     * @param mtMemberDetail 成员进出明细
     * @return 成员进出明细
     */
    @Override
    public List<MtMemberDetail> selectMtMemberDetailList(MtMemberDetail mtMemberDetail)
    {
        return mtMemberDetailMapper.selectMtMemberDetailList(mtMemberDetail);
    }

    /**
     * 新增成员进出明细
     * 
     * @param mtMemberDetail 成员进出明细
     * @return 结果
     */
    @Override
    public int insertMtMemberDetail(MtMemberDetail mtMemberDetail)
    {
        mtMemberDetail.setCreateTime(DateUtils.getNowDate());
        return mtMemberDetailMapper.insertMtMemberDetail(mtMemberDetail);
    }

    /**
     * 修改成员进出明细
     * 
     * @param mtMemberDetail 成员进出明细
     * @return 结果
     */
    @Override
    public int updateMtMemberDetail(MtMemberDetail mtMemberDetail)
    {
        mtMemberDetail.setUpdateTime(DateUtils.getNowDate());
        return mtMemberDetailMapper.updateMtMemberDetail(mtMemberDetail);
    }

    /**
     * 批量删除成员进出明细
     * 
     * @param detailIds 需要删除的成员进出明细主键
     * @return 结果
     */
    @Override
    public int deleteMtMemberDetailByDetailIds(Long[] detailIds)
    {
        return mtMemberDetailMapper.deleteMtMemberDetailByDetailIds(detailIds);
    }

    /**
     * 删除成员进出明细信息
     * 
     * @param detailId 成员进出明细主键
     * @return 结果
     */
    @Override
    public int deleteMtMemberDetailByDetailId(Long detailId)
    {
        return mtMemberDetailMapper.deleteMtMemberDetailByDetailId(detailId);
    }
}
